﻿<local:BasePage
    x:Class="BogheApp.CallPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:BogheApp"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,0,0,0">
            <StackPanel Orientation="Horizontal">
                <TextBlock x:Name="ApplicationTitleText" Text="{Binding ApplicationTitle}" Style="{StaticResource PhoneTextNormalStyle}"/>
                <TextBlock x:Name="HoldStateText" Text="{Binding HoldStateText}" Style="{StaticResource PhoneTextNormalStyle}" Foreground="Green"/>
            </StackPanel>
            <TextBlock x:Name="CallStateText" Text="{Binding CallStateText}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" HorizontalAlignment="Stretch" Name="MainStackPanel" VerticalAlignment="Stretch">
                <TextBlock Name="CalleeNameText" Text="{Binding RemotePartyDisplayName}" Margin="10,5,10,0" Style="{StaticResource PhoneTextExtraLargeStyle}">Caller Name</TextBlock>
                <StackPanel Name="CalleeInfoStackPanel" Orientation="Horizontal">
                    <TextBlock Name="CalleeNumberText" Text="{Binding RemotePartyNumber}" Margin="10,5,10,10" Style="{StaticResource PhoneTextSmallStyle}">Caller Number</TextBlock>
                    <TextBlock Name="CallStartTimeText" Text="{Binding CallStartTime}" Margin="10,5,10,10" Style="{StaticResource PhoneTextSmallStyle}">Call Start Time</TextBlock>
                </StackPanel>
                <StackPanel Name="AudioRouteStackPanel" Orientation="Horizontal">
                    <Button IsEnabled="{Binding IsEarpieceButtonEnabled}" Margin="0,10,0,10" Name="EarpieceButton" BorderBrush="{Binding EarpieceButtonBorder}" Click="EarpieceButton_Click">
                        <TextBlock Text="earpiece" Style="{StaticResource PhoneTextSmallStyle}" Margin="0" />
                    </Button>
                    <Button IsEnabled="{Binding IsSpeakerButtonEnabled}" Margin="0,10,0,10" Name="SpeakerButton" BorderBrush="{Binding SpeakerButtonBorder}" Click="SpeakerButton_Click">
                        <TextBlock Text="speaker" Style="{StaticResource PhoneTextSmallStyle}" Margin="0" />
                    </Button>
                    <Button IsEnabled="{Binding IsBluetoothButtonEnabled}" Margin="0,10,0,10" Name="BluetoothButton" BorderBrush="{Binding BluetoothButtonBorder}" Click="BluetoothButton_Click">
                        <TextBlock Text="bluetooth" Style="{StaticResource PhoneTextSmallStyle}" Margin="0" />
                    </Button>
                </StackPanel>
                <Canvas>
                    <!--These MediaElements have not defined their stretch modes, and so will letterbox automatically-->
                    <!--To avoid letterboxing, you can change it by setting Stretch property-->
                    <MediaElement Visibility="{Binding BigHeadVisibility}" MediaOpened="bigHead_MediaOpened_1" MediaFailed="bigHead_MediaFailed_1" x:Name="bigHead" Source="{Binding BigHeadPreviewUri}" Width="456" Height="510" RenderTransformOrigin="0.5,0.5" >
                        <!--MediaElement.RenderTransform>
                            <CompositeTransform Rotation="{Binding CameraRotation}"/>
                        </MediaElement.RenderTransform-->
                    </MediaElement>
                    <MediaElement Visibility="{Binding LittleHeadVisibility}" MediaOpened="littleHead_MediaOpened_1" MediaFailed="littleHead_MediaFailed_1" x:Name="littleHead" Source="{Binding LittleHeadPreviewUri}" Canvas.Top="370" Width="120" Height="90" RenderTransformOrigin="0.5,0.5" Canvas.Left="7" >
                        <MediaElement.RenderTransform>
                            <CompositeTransform Rotation="{Binding CameraRotation}"/>
                        </MediaElement.RenderTransform>
                    </MediaElement>
                </Canvas>
            </StackPanel>
            <StackPanel Grid.Row="1" HorizontalAlignment="Stretch" Name="BottomStackPanel" VerticalAlignment="Bottom" Orientation="Horizontal">
                <Button Content="hang up" IsEnabled="{Binding IsHangUpButtonEnabled}" Height="72" HorizontalAlignment="Left" Margin="0,25,0,5" Name="HangUpButton" VerticalAlignment="Bottom" Width="Auto" Click="HangUpButton_Click" />
                <Button Name="HoldButton" IsEnabled="{Binding IsHoldButtonEnabled}" Margin="0,25,5,5" Content="{Binding HoldButtonText}" Click="HoldButton_Click" HorizontalAlignment="Left" VerticalAlignment="Center" />
                <Button Name="CameraToggleButton" IsEnabled="{Binding IsCameraToggleButtonEnabled}" Margin="0,25,5,5" Content="{Binding CameraToggleButtonText}" Click="CameraToggleButton_Click" HorizontalAlignment="Left" VerticalAlignment="Center" />
            </StackPanel>
        </Grid>
    </Grid>

</local:BasePage>